"""
@title(TenX腾晓2024年12月考核答题文件)
@warning(请勿修改参数和返回值)
@warning(请认真填写__init__中的数据)
@author(1323230180)
@license(CC BY-SA 4.0 License)
"""
import os
from copy import deepcopy


class TenXClass:
    def __init__(self):
        # 获取当前文件名并截取文件名的学号-姓名
        file_name = os.path.basename(__file__).split('.')[0].split("-")
        self.id = file_name[0]  # 学号
        self.name = file_name[1]  # 姓名

    @staticmethod
    def question1(*args) -> list[str]:
        class TreeNode:
            def __init__(self, value):
                self.value = value
                self.left = None  # 如果不为None，那就是另一个TreeNode
                self.right = None  # 同理

        class BinaryTree:
            def __init__(self, root=None):
                self.root = root
        binary_tree = deepcopy(args[0])  # 传入的地牢结构（二叉树），详细请看BinaryTree.py

    @staticmethod
    def question2(*args) -> str:
        matrix = deepcopy(args[0])  # 传入的河流结构（矩阵）
        fin_str = ''
        for list in matrix:
            maxnum = str(max(list))
            fin_str = fin_str + maxnum
        return fin_str

    @staticmethod
    def question3(*args) -> int:
        count=6*pow(7,999,99999999)
        fin_count=count-5*pow(6,999,99999999)
        return fin_count


    @staticmethod
    def question4(*args) -> int:
        n = deepcopy(args[0])  # 用于搭建金字塔的球个数
        m=1
        while m*(m+1)*(m+2)//6<=n:
            m+=1
        x=m-1
        return x
    @staticmethod
    def question5(*args) -> str:
        balls = deepcopy(args[0])  # 五行空间球的初始值
        def change(balls):
            for x in balls:
                if all(x > 10000 for x in balls):
                    break
                else:
                    balls[0] = balls[3] + balls[4]
                    balls[1] = balls[4] + balls[0]
                    balls[2] = balls[0] + balls[1]
                    balls[3] = balls[1] + balls[2]
                    balls[4] = balls[2] + balls[3]
            balls = list(map(str, balls))
        return balls
